package com.springBoot.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.springBoot.Service.UserService;

@Controller
public class UserController {
	
	@Autowired
	private UserService userService;

	@RequestMapping("/user")
	public String user(HttpServletRequest request) {
		request.setAttribute("user", userService.getUser());
		return "userList";
	}
	
	@RequestMapping("/login")
	@ResponseBody
	public String login(String name,String password,HttpServletRequest request) {
		return "name:"+name+"password:"+password;
	}

}
